{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "3b1a409a",
   "metadata": {},
   "source": [
    "### 1.介绍request"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "91a0958c",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 调用模块\n",
    "import requests"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "488ede9b",
   "metadata": {},
   "outputs": [],
   "source": [
    "# res\n",
    "# r\n",
    "# response"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "96bf3337",
   "metadata": {},
   "outputs": [
    {
     "ename": "NameError",
     "evalue": "name 'request' is not defined",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mNameError\u001b[0m                                 Traceback (most recent call last)",
      "\u001b[1;32m<ipython-input-3-78dde5b1c79c>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[0mr\u001b[0m \u001b[1;33m=\u001b[0m\u001b[0mrequest\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mget\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m'https://cn.bing.com/search'\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m",
      "\u001b[1;31mNameError\u001b[0m: name 'request' is not defined"
     ]
    }
   ],
   "source": [
    "r =request.get('https://cn.bing.com/search')"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "05b6c6f8",
   "metadata": {},
   "source": [
    "## 2种查看页面数据的方式\n",
    "* content\n",
    "> 1. 二进制的数据信息，可以观察数据格式\n",
    ">>1.HTML  \n",
    ">>2.json"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "ea6c3542",
   "metadata": {},
   "outputs": [],
   "source": [
    "r =request.get(https://api.github.com)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.8"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
